package com.ihighest.app.common.api;

import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedHashMap;

/**
 * Api请求参数
 * 
 * @author Vity
 * @date 2015-5-13
 * @mail vity.1215@gmail.com
 */
public class ApiParam implements Serializable {

	private static final long serialVersionUID = -8774585720957992575L;

	// 空参数
	public static ApiParam Empty = null;

	private ApiParam() {
		params = new LinkedHashMap<>();
	}

	LinkedHashMap<String, Object> params;

	public static ApiParam create() {
		return new ApiParam();
	}

	public ApiParam addParam(String key, String value) {
		params.put(key, value);
		return this;
	}

	public ApiParam addParam(String key, int value) {
		params.put(key, String.valueOf(value));
		return this;
	}

	public ApiParam addParam(String key, long value) {
		params.put(key, String.valueOf(value));
		return this;
	}

	public ApiParam addParam(String key, double value) {
		params.put(key, String.valueOf(value));
		return this;
	}

	public ApiParam addParam(String key, File value) {
		params.put(key, value);
		return this;
	}

	public ApiParam addParam(String key, ArrayList<File> value) {
		params.put(key, value);
		return this;
	}

	public LinkedHashMap<String, Object> getParams() {
		return params;
	}
}
